package cn.edu.seu.ssny.dao;

import cn.edu.seu.ssny.dao.support.IBaseDao;
import cn.edu.seu.ssny.entity.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface IDeviceDao extends IBaseDao<Device, Integer> {
    Device findByName(String name);

    Optional<Device> findByNameAndProject(String name, Project project);

    Device findByProjectAndGatewayAndTag(Project project, Gateway gateway, String tag);

    List<Device> findByProject(Project project);

    List<Device> findByEnterprise(Enterprise enterprise);

    List<Device> findByProjectAndTemplateOrderByName(Project project, DeviceTemplate template);

    Optional<Device> findByEquipmentAndDescriptionLike(Equipment equipment, String name);

    Device findByEquipmentAndDescription(Equipment equipment, String description);

    List<Device> findByEquipmentInAndDescriptionLike(List<Equipment> equipments, String desc);
}
